﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>

<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<div class="modal-dialog ms-modal-dialog">
    <div class="modal-content">

        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">
                <span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
            </button>
            <h4 class="modal-title">Session&nbsp;-&nbsp;Search</h4>
        </div>

        <form class="form-horizontal ms-form" role="form" method="GET" action="${ctx.host}/session-reports">

            <input type="hidden" name="filter" value="true">

            <div class="modal-body">
            
              <div class="alert alert-danger hide">
              </div>

              <div class="form-group ms-form-group">
                <label class="col-xs-3 control-label">session</label>
                <div class="col-xs-7">
                  <select name="session" class="select2 form-control">
                    <option value=""></option>
                    <c:forEach var="session" items="${persist.session(currentPrincipal.id)}">
                      <option value="${session.id}">${session.name}</option>
                    </c:forEach>
                  </select>
                </div>
              </div>

              <div class="form-group ms-form-group">
                <label class="col-xs-3 control-label">delegate</label>
                <div class="col-xs-7">
                  <select name="delegate" class="select2 form-control">
                    <option value=""></option>
                    <c:forEach var="delegate" items="${persist.delegate(currentPrincipal.id)}">
                      <option value="${delegate.id}">${delegate.name}</option>
                    </c:forEach>
                  </select>
                </div>
              </div>

            </div>

            <div class="modal-footer">
                <button type="button" class="btn ms-btn btn-primary search-submit">Commit</button>
                <button type="button" class="btn ms-btn ms-btn-gary" data-dismiss="modal">Cancel</button>
            </div>
        </form>
    </div>

   <script type="text/javascript">
      $(document).ready(function() {

          $('select').select2({
              placeholder : '请选择',
              minimumResultsForSearch : -1,
              allowClear : true
          });

        })
    </script>


</div>
